<?php

namespace app\libs\TongtuSDK\Model;
class OrderModel
{
    protected $buyerInfo;
    protected $paymentInfos;
    protected $transactions;
    protected $currency;
    protected $insuranceIncome;
    protected $insuranceIncomeCurrency;
    protected $needReturnOrderId;
    protected $notes;
    protected $ordercurrency;
    protected $platformCode;
    protected $remarks;
    protected $saleRecordNum;
    protected $sellerAccountCode;
    protected $shippingMethodId;
    protected $taxIncome;
    protected $taxIncomeCurrency;
    protected $totalPrice;
    protected $totalPriceCurrency;
    protected $warehouseId;


    /**
     * @return mixed
     */
    public function getBuyerInfo(): array
    {
        return $this->buyerInfo->toArray();
    }

    /**
     * @param mixed $buyerInfo
     */
    public function setBuyerInfo(BuyerInfo $buyerInfo): OrderModel
    {
        $this->buyerInfo = $buyerInfo;
        return $this;
    }

    /**
     * @return mixed
     */
    public function getPaymentInfos()
    {
       $paymentInfo = [];
       foreach ($this->paymentInfos as $info){
           $paymentInfo[] = $info->toArray();
       }
      return $paymentInfo;
    }

    /**
     * @param mixed $paymentInfos
     */
    public function setPaymentInfos($paymentInfos): OrderModel
    {
        $this->paymentInfos = $paymentInfos;
        return $this;
    }


    public function setCurrency(string $currency) :OrderModel
    {
        $this->currency = $currency;
        return $this;
    }


    public function getCurrency() :string
    {
        return  $this->currency;
    }

    public function setNotes(string $notes) :OrderModel
    {
        $this->notes = $notes;
        return $this;
    }

    public function getNotes()
    {
        return $this->notes;
    }

    /**
     * @return string
     */
    public function getOrdercurrency(): string
    {
        return $this->ordercurrency;
    }

    /**
     * @param string $ordercurrency
     */
    public function setOrdercurrency(string $ordercurrency): OrderModel
    {
        $this->ordercurrency = $ordercurrency;
        return $this;
    }

    /**
     * @return string
     */
    public function getInsuranceIncome(): string
    {
        return $this->insuranceIncome;
    }

    /**
     * @param string $insuranceIncome
     */
    public function setInsuranceIncome(string $insuranceIncome): OrderModel
    {
        $this->insuranceIncome = $insuranceIncome;
        return $this;
    }

    /**
     * @return string
     */
    public function getInsuranceIncomeCurrency(): string
    {
        return $this->insuranceIncomeCurrency;
    }

    /**
     * @param string $insuranceIncomeCurrency
     */
    public function setInsuranceIncomeCurrency(string $insuranceIncomeCurrency): OrderModel
    {
        $this->insuranceIncomeCurrency = $insuranceIncomeCurrency;
        return $this;
    }

    /**
     * @return string
     */
    public function getNeedReturnOrderId(): string
    {
        return $this->needReturnOrderId;
    }

    /**
     * @param string $needReturnOrderId
     */
    public function setNeedReturnOrderId(string $needReturnOrderId): OrderModel
    {
        $this->needReturnOrderId = $needReturnOrderId;
        return $this;
    }

    /**
     * @param mixed $platformCode
     * @return OrderModel
     */
    public function setPlatformCode($platformCode)
    {
        $this->platformCode = $platformCode;
        return $this;
    }

    /**
     * @param mixed $remarks
     * @return OrderModel
     */
    public function setRemarks($remarks): OrderModel
    {
        $this->remarks = $remarks;
        return $this;
    }

    public function getRemarks()
    {
        return $this->remarks;
    }

    /**
     * @return mixed
     */
    public function getSaleRecordNum()
    {
        return $this->saleRecordNum;
    }

    /**
     * @param mixed $saleRecordNum
     */
    public function setSaleRecordNum($saleRecordNum): OrderModel
    {
        $this->saleRecordNum = $saleRecordNum;
        return $this;
    }

    /**
     * @return mixed
     */
    public function getSellerAccountCode()
    {
        return $this->sellerAccountCode;
    }

    /**
     * @param mixed $sellerAccountCode
     */
    public function setSellerAccountCode($sellerAccountCode): OrderModel
    {
        $this->sellerAccountCode = $sellerAccountCode;
        return $this;
    }

    /**
     * @return mixed
     */
    public function getShippingMethodId()
    {
        return $this->shippingMethodId;
    }

    /**
     * @param mixed $shippingMethodId
     */
    public function setShippingMethodId($shippingMethodId): OrderModel
    {
        $this->shippingMethodId = $shippingMethodId;
        return $this;
    }

    /**
     * @return mixed
     */
    public function getTaxIncome()
    {
        return $this->taxIncome;
    }

    /**
     * @param mixed $taxIncome
     */
    public function setTaxIncome($taxIncome): OrderModel
    {
        $this->taxIncome = $taxIncome;
        return $this;
    }

    /**
     * @return mixed
     */
    public function getTaxIncomeCurrency()
    {
        return $this->taxIncomeCurrency;
    }

    /**
     * @param mixed $taxIncomeCurrency
     */
    public function setTaxIncomeCurrency($taxIncomeCurrency): OrderModel
    {
        $this->taxIncomeCurrency = $taxIncomeCurrency;
        return $this;
    }

    /**
     * @return mixed
     */
    public function getTotalPrice()
    {
        return $this->totalPrice;
    }

    /**
     * @param mixed $totalPrice
     */
    public function setTotalPrice($totalPrice): OrderModel
    {
        $this->totalPrice = $totalPrice;
        return $this;
    }

    /**
     * @return mixed
     */
    public function getTotalPriceCurrency()
    {
        return $this->totalPriceCurrency;
    }

    /**
     * @param mixed $totalPriceCurrency
     */
    public function setTotalPriceCurrency($totalPriceCurrency): OrderModel
    {
        $this->totalPriceCurrency = $totalPriceCurrency;
        return $this;
    }

    /**
     * @return mixed
     */
    public function getWarehouseId()
    {
        return $this->warehouseId;
    }

    /**
     * @param mixed $warehouseId
     */
    public function setWarehouseId($warehouseId): OrderModel
    {
        $this->warehouseId = $warehouseId;
        return $this;
    }

    public function setTransactions($transaction)
    {
        $this->transactions = $transaction;
        return $this;
    }

    public function getTransactions()
    {
       $transactions = [];
       foreach ($this->transactions as $item){
           $transactions[] = $item->toArray();
       }
       return $transactions;
    }


}
